package com.rtx.edi.platform.baseinfo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rtx.edi.model.apibaseinfo.po.PlApibaseinfo;
import com.rtx.edi.platform.baseinfo.mapper.PlApibaseinfoMapper;
import com.rtx.edi.platform.baseinfo.service.PlApibaseinfoService;

/**
 * <p>
 * api基础信息表 服务实现类
 * </p>
 *
 * @author zcw
 * @since 2023-03-19
 */
@Service
public class PlApibaseinfoServiceImpl extends ServiceImpl<PlApibaseinfoMapper, PlApibaseinfo> implements PlApibaseinfoService {

	
	@Autowired
	PlApibaseinfoMapper plApibaseinfoMapper;
	
	@Override
	public void selectPlApibaseinfoList(Page<PlApibaseinfo> pageParam, PlApibaseinfo qcd) {
	       LambdaQueryWrapper<PlApibaseinfo> query = Wrappers.lambdaQuery();
	       query.like(qcd.getApiDomail()!=null, PlApibaseinfo::getApiDomail,qcd.getApiDomail());
	       query.like(qcd.getApiName()!=null, PlApibaseinfo::getApiName,qcd.getApiName());
	       query.eq(qcd.getApplicationId()!=null, PlApibaseinfo::getApplicationId,qcd.getApplicationId());
	       baseMapper.selectPage(pageParam,query);
	}


	public List<PlApibaseinfo> selectPlApibaseinfoList() {
		return baseMapper.selectList(new QueryWrapper<>());
	}
}
